<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="master.html"/>
<head/>

<body>
<div id="ViewProjectBox">
  <h2 id="title" py:content="project.title">Project Title</h2>
  <div py:if="len(tg.contexts) &lt; 1" id="createAction">
     You have not created any context, so you cannot add actions...
  </div>

  <div id="linkbar">
    <label style="color: grey">${project.modified} (created ${project.created})</label>

    <a id="edit_project_link" href="#" onclick="toggle('edit_project');$('#edit_project').ScrollTo(800);"><img src="/static/images/edit.png" title="edit"/></a>
    <a py:if="not project.closed" id="close_project_link" href="#" onclick="toggle('confirm_close_project');"><img src="/static/images/done.gif" title="done"/></a>
    <a py:if="project.closed" href="/project/open/${project.id}"><img src="/static/images/open.png" title="re-opem"/></a>
    <div id="confirm_close_project" class="confirm" style="display: none">
      Are you sure you want to close the project?
      <a href="/project/close/${project.id}">Yes</a>
      <a href="#" onclick="toggle('confirm_close_project');">No</a>
    </div>


    <a id="delete_project_link" href="#" onclick="toggle('confirm_delete_project');"><img src="/static/images/delete.gif" title="delete"/></a>

    <div id="confirm_delete_project" class="confirm" style="display: none">
      Are you sure you want to delete the project?
      <a href="/project/delete/${project.id}">Yes</a>
      <a href="#" onclick="toggle('confirm_delete_project');">No</a>
    </div>

    <a py:if="len(tg.contexts) &gt; 0" id="createAction" href="#" onclick="toggle('AddActionBox');$('#AddActionBox').ScrollTo(800);">
      <img src="/static/images/new.gif" title="add action"/>
    </a>
  </div>

  <!-- <span id="notes_content">${project._get_textilizedNotes()}</span> -->
</div>

<div id="edit_project" style="display: none;">
  <form action="#" >
    <fieldset>
      <legend>Edit</legend>
      <input type="hidden" id="id" name="id" value="${project.id}"/>
      <p>
        <label for="title_input">Title</label>
        <input type="text_input" id="title_input" value="${project.title}" onkeypress="handleKeyPress(event)"/>
      </p>
      <p>
        <label for="notes_input">Notes</label>
        <textarea id="notes_input">${project.notes}</textarea>
      </p>
      <input type="submit" onclick="update_project();toggle('edit_project');$('#ViewProjectBox').ScrollTo(800);" value="save"/>
      <input type="submit" onclick="toggle('edit_project'); $('#ViewProjectBox').ScrollTo(800);return false;" value="cancel"/>
    </fieldset>
</form>
</div>

<br/>

<xi:include href="createAction.html" />

<br/>

<h3>Open Actions</h3>
<xi:include href="openActions.html" />

<br/>
View Closed Actions <a href="#" id="show_closed_actions" onclick="toggle('closed_actions'); return false;">[+]</a>
<div id="closed_actions" style="display: none;">
  <xi:include href="closedActions.html" />
</div>


</body>
</html>
